library(dplyr)
library(tidyverse)
library(knitr)
library(plotly)
library(kableExtra)

1 Introduction

2 Domain knowledge

2.1 Grennhouse Gases (GHG)

2.1.1 Definition

  • Greenhouse gases constitute a group of gases contributing to global warming and climate change.
  • Greenhouse gases are gases that trap heat in the atmosphere.
  • Without greenhouse gases, the average temperature of Earth’s surface would be about -18° rather than the present average of 15°.
  • Atmospheric concentrations are determined by the balance between sources (emissions of the gas from human activities and natural systems) and sinks (the removal of the gas from the atmosphere by conversion to a different chemical compound or absorption by bodies of water).

2.1.2 List

The primary greenhouse gases in Earth’s atmosphere are water vapor (H2O), carbon dioxide (CO2), methane (CH4), nitrous oxide (N2O) and ozone (O3).

-Carbon dioxide (CO2):

  • Carbon dioxide enters the atmosphere through burning fossil fuels (coal, natural gas, and oil), solid waste, trees and other biological materials, and also as a result of certain chemical reactions (e.g., manufacture of cement).
  • Carbon dioxide is removed from the atmosphere (or “sequesterd”) when it is absorbed by plants as part of the biological carbon cycle.

-Methane (CH4):

  • Methane is emitted during the production and transport of coal, natural gas, and oil. Methane emissions also result from livestock and other agricultural practices.

-Nitrous oxide (N2O):

  • Nitrous oxide is emitted during agricultural and industrial activities, combustion of fossil fuels and solid waste, as well as during treatment of wastewater.

-Fluorinated gases:

  • Hydrofluocarbons, perfluocarbons, sulfur hexafluoride, and nitrogen trfluoride are synthetic, powerful greenhouse gases that are emitted from a variety of industrial processes. These gases are typically emitted in sammer quantities, but because they are potent greenhouse gases, they are sometimes referred to as high Global Warming Potential gase

2.1.3 Sources

  • The vast majority of anthropogenic carbon dioxide emissions come from combustion of fossil fuels, principally coal, oil and natural gas, with additional contributions coming from deforestation and other changes in land use.

2.1.4 Global Warming Potential

GHGs warm the earth by absorbing energy and slowing the rate at which the energy escapes to space. Different GHGs can have different effects on the earth’s warming depending on their ability to absorb energy (radiative efficiency) and how long they stay in the atmosphere (lifetime).

The Global Warming Potential was developed to allow comparisons of the global warming impacts of different gases. It is a measure of how much energy the emission of 1 ton of a gas will absorb over a given period of time, relative to the emissions of 1 ton of carbon dioxide. The larger the GWP, the more that given gas warms the earth compared to CO2 over that time period (usually 100 years). GWP provides a common unit of measure which allows analysts to add up emissions estimates of different gases (e.g., to compile a national GHG inventory), and allows policymakers to compare emissions reduction opportunities across sectors.

  • CO2, by definition, has a GWP of 1 regardless of the time period used since it is the gas used as the reference. CO2 emissions cause an increase in the atmospheric concentrations that will least thousands of years.

  • Methane (CH4) is estimated to have a GWP of 28-36 over 100 years. CH4 emitted today lasts about a decade on average, which is much less time thanCO2. But CH4 absorbs much more energy than CO2.

  • Nitrous Oxide (N2O) has a GWP 265-298 times that of CO2 for a 100-year timescale. BO2 emitted today remains in the atmosphere for more than 100 years, on average.

  • Fluorinated gases are high-GWP gases because, for a given amount of mass, they trap substantially more than CO2. The GWPs for these gases can be in the thousands or tens of thousands.

2.2 Glossary

2.2.1 Carbon Budget

  • A carbon budget is an upper limit of total CO2 emissions associated with remaining below a specific global average - temperature.

  • Global emissions budgets are calculated according to historical cumulative emissions from fossil, industrial processes, and land use change, but vary according to the global temperature target that is chosen, the probability of staying below that target, and the emissions of other non CO2 greenhouse gases.

  • Emissions budgets are relevant to climate change mitigation because they indicate a finite amount of carbon dioxide that can be emitted over time, before resulting in dangerous levels of global warming.

3 World scale

3.1 Data sources

3.1.1 World bank data

3.1.2 The United Nations Framework Convention on Climate Change (UNFCCC)

  • History:

The UNFCCC is an international environmental treaty addressing climate change, negotiated by 154 states at tht United Nations Conference on Environment and Development, informally known as the Earth Summit, held in Rio de Janiero in 1992.

  • Objectives:

    • The UNFCCC seeks for the stabilization of greenhouse gas concentrations in the atmosphere at a level that would prevent dangerous anthropogenic human-induced interferences with the earth’s climate system.
    • Definition guidelines for submitting annual national greenhouse gas emissions inventories
    • The GHG data displayed on the UNFCC website are data from official submissions of GHG emissions/removals data by countries that are Parties to the Climate Change Convention.
  • Parties:

The Convention divides countries into three main groups according to differing commitments. Here is the description of these categories (source).

-*Annex I* Parties include the Industrialized  countries that were members of the OECD (Organization for Economic Co-operation and Development) in 1992, plus countries with economies in transition (the EIT parties), including the Russian Federation, the Baltic States, and several Central and Eastern European States.

-*Annex II* Parties consist of the OECD members of Annex I, but not the EIT Parties. They are required to provide financial resources to enable developing countries to undertake emissions reduction activities under the Convention and to help them adapt to adverse effects of climate change.

- *Non-Annex I* Parties are mostly developing countries. Certain groups of developing countries are recognized by the Convention as being especially vulnerable to the adverse impacts of climate change, including countries with low-lying coastal areas and those prone to desertification and drought. Others (such as countries that rely heavily on income from fossil fuel production and commerce) feel more vulnerable to the potential economic impacts of climate change response measures.

3.1.3 World Resources Institute

  • CAIT - Historical Emissions Data:

CAIT Historic allow for easy access, analysis and visualization of the latest available international greenhouse gas emissions data. It includes information for 191 countries and the European Union, 50 U.S. states, 6 gases, multiple economic sectors, and 160 years - carbon dioxide emissions for 1850-2014 and multi-sector greenhouse gas emission for 1990-2014.

More description is available here

3.2 Data sources exploration

3.2.1 World Bank

  • Data collection:

  • Total greenhouse gas emissions (kt of CO2 equivalent)

library(WDI)
 
#get datasets on emissions
datasets = WDIsearch("emissions")

# get Total greenhouse gas emissions (kt of CO2 equivalent)

ghg_emissions_wb = WDI(indicator='EN.ATM.GHGT.KT.CE')

# get all world data
ghg_emissions_wb_world = ghg_emissions_wb %>% 
  filter(country == "World")

# Show data sample 
ghg_emissions_wb_world %>% 
  top_n(10) %>% 
  kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover"), full_width = F, font_size = 13) %>% 
  scroll_box(width = "100%", height = "400px")
iso2c country EN.ATM.GHGT.KT.CE year
1W World NA 2020
1W World NA 2019
1W World NA 2018
1W World NA 2017
1W World NA 2016
1W World NA 2015
1W World NA 2014
1W World NA 2013
1W World 53526303 2012
1W World 52790527 2011
# plot world GHG emissions
ghg_emissions_wb_world %>% 
  plot_ly() %>% 
  add_trace(y = ~EN.ATM.GHGT.KT.CE, 
            x = ~year, 
            marker = list(color = "gray"),
            type = 'scatter',
            # type = "line",
            mode = 'lines+markers',
            orientation = "v") %>% 
  layout(title = "World GHG emissions (source: WorldBank)",
         yaxis = list(title = "GHG emissions"), 
         xaxis = list(title = "Years"))

3.2.2 World Resources Institute

  • Data is provided by API or download
  • In this example we will explore the downloaded data
# load data
ghg_emissions_wri = read.csv("https://raw.githubusercontent.com/OpenGeoScales/CarbonData/feature-article/datasets/raw/wri/historical_emissions/historical_emissions.csv", 
                             encoding = "UTF-8")
  • Data contains GHG emissions timeserie in wide format
Column Description
Country The country name
Data.source Five data sources: CAIT, PIK, GCP, UNFCCC_AI, UNFCCC_NAI
Sector 30 categories of sectors: Total including LUCF,Total excluding LUCF, Total fossil fuels and cement, Electricity/Heat, Coal, Oil
Gas 8 categories of sectors: All GHG,KYOTOGHG, CO2, Aggregate GHGs, CH4, N2O, F-Gas , Aggregate F-gases
Unit One unit: MtCO₂e
1850 Emission quantity in 1850
1851 Emission quantity in 1850
.. Emission quantity in 1851
2019 Emission quantity in 2019
  • Sector categories by data source : Categories used for sectors and gases depend on data source.
# get sectors from different data sources
sector_CAIT = ghg_emissions_wri %>% 
  filter(Data.source == "CAIT") %>% 
  distinct(Sector) %>% 
  select(Sector.CAIT = Sector) %>% 
  arrange(Sector.CAIT)

sector_PIK = ghg_emissions_wri %>% 
  # select PIK datasource
  filter(Data.source == "PIK") %>% 
  distinct(Sector) %>% 
  select(Sector.PIK = Sector) %>% 
  arrange(Sector.PIK)

sector_GCP = ghg_emissions_wri %>% 
  # select GCP datasource
  filter(Data.source == "GCP") %>% 
  distinct(Sector) %>% 
  select(Sector.GCP = Sector) %>% 
  arrange(Sector.GCP)

sector_UNFCCC_AI = ghg_emissions_wri %>% 
  # select UNFCCC_AI datasource
  filter(Data.source == "UNFCCC_AI") %>% 
  distinct(Sector) %>%  
  select(Sector.UNFCCC_AI = Sector) %>% 
  arrange(Sector.UNFCCC_AI)

sector_UNFCCC_NAI = ghg_emissions_wri %>% 
  # select UNFCCC_NAI datasource
  filter(Data.source == "UNFCCC_NAI") %>% 
  distinct(Sector) %>% 
  select(Sector.UNFCCC_NAI = Sector) %>% 
  arrange(Sector.UNFCCC_NAI)

# plot table
knitr::kable(list(sector_CAIT, sector_PIK, sector_GCP, sector_UNFCCC_AI, sector_UNFCCC_NAI)) %>% 
  kable_styling(bootstrap_options = c("striped", "hover"), full_width = F, font_size = 12) %>% 
  scroll_box(width = "100%", height = "200px")
Sector.CAIT
Agriculture
Building
Bunker Fuels
Electricity/Heat
Energy
Fugitive Emissions
Industrial Processes
Land-Use Change and Forestry
Manufacturing/Construction
Other Fuel Combustion
Total excluding LUCF
Total including LUCF
Transportation
Waste
Sector.PIK
Agriculture
Energy
Industrial Processes and Product Use
Other
Total excluding LULUCF
Waste
Sector.GCP
Bunkers
Cement
Coal
Gas
Gas flaring
Oil
Total fossil fuels and cement
Sector.UNFCCC_AI
Agriculture
Energy
Industrial Processes and Product Use
Land Use, Land-Use Change and Forestry
Other
Total GHG emissions with LULUCF
Total GHG emissions without LULUCF
Waste
Sector.UNFCCC_NAI
Agriculture
Energy
Industrial Processes
Land-Use Change and Forestry
Other
Solvent and Other Product Use
Total GHG emissions excluding LULUCF/LUCF
Total GHG emissions including LULUCF/LUCF
Waste
  • Gas categories by data source : Categories used for gases depend on data source.
# get gas from different data sources
gas_CAIT = ghg_emissions_wri %>% 
  filter(Data.source == "CAIT") %>% 
  distinct(Gas) %>% 
  select(Gas.CAIT = Gas) %>% 
  arrange(Gas.CAIT)

gas_PIK = ghg_emissions_wri %>% 
  # select PIK datasource
  filter(Data.source == "PIK") %>% 
  distinct(Gas) %>% 
  select(Gas.PIK = Gas) %>% 
  arrange(Gas.PIK)

gas_GCP = ghg_emissions_wri %>% 
  # select GCP datasource
  filter(Data.source == "GCP") %>% 
  distinct(Gas) %>% 
  select(Gas.GCP = Gas) %>% 
  arrange(Gas.GCP)

gas_UNFCCC_AI = ghg_emissions_wri %>% 
  # select UNFCCC_AI datasource
  filter(Data.source == "UNFCCC_AI") %>% 
  distinct(Gas) %>%  
  select(Gas.UNFCCC_AI = Gas) %>% 
  arrange(Gas.UNFCCC_AI)

gas_UNFCCC_NAI = ghg_emissions_wri %>% 
  # select UNFCCC_NAI datasource
  filter(Data.source == "UNFCCC_NAI") %>% 
  distinct(Gas) %>% 
  select(Gas.UNFCCC_NAI = Gas) %>% 
  arrange(Gas.UNFCCC_NAI)

# plot table
knitr::kable(list(gas_CAIT, gas_PIK, gas_GCP, gas_UNFCCC_AI, gas_UNFCCC_NAI)) %>% 
  kable_styling(bootstrap_options = c("striped", "hover"), full_width = F, font_size = 12) %>% 
  scroll_box(width = "100%", height = "200px")
Gas.CAIT
All GHG
CH4
CO2
F-Gas
N2O
Gas.PIK
CH4
CO2
F-Gas
KYOTOGHG
N2O
Gas.GCP
CO2
Gas.UNFCCC_AI
Aggregate F-gases
Aggregate GHGs
CH4
CO2
N2O
Gas.UNFCCC_NAI
Aggregate F-gases
Aggregate GHGs
CH4
CO2
N2O
  • Number of countries by data source The number of considered countries is not the same depending on the data sources as shown in the table below:
ghg_emissions_wri %>% 
  group_by(Data.source) %>% 
  summarise(Nb.Country=length(unique(Country))) %>% 
  kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover"), full_width = F, font_size = 13) 
Data.source Nb.Country
CAIT 195
GCP 196
PIK 216
UNFCCC_AI 45
UNFCCC_NAI 148
  • CAIT data source contains data for 193 distinct countries (all countries that are member states of the United Nations) with aggregated data on world scale (World) and European Union (European Union (27))

  • GCP data source contains data for the 193 countries members states of the United Nations plus the state of Palestine and aggregated data on world scale (World) and European Union (European Union (27))

  • PIK data source contains data for the 193 countries members states of the United Nations in addition to aggregated data on groups of countries such as: Umbrella Group, Least Developed Countries, Non-Annex-I Parties to the Convention, Annex-I Parties to the Convention

  • UNFCCC Annex I data source contains data for 43 countries members of the Annex I convention with aggregated data on belonging parties (Annex-I Parties to the Convention) and European Union scale (European Union (27)).

  • UNFCCC Non-Annex I data source contains data for 148 countries that are parts of the non-Annex I convention.

3.2.2.1 WRI - CAIT

  • *Description**:

CAIT Historic allow for easy access, analysis and visualization of the latest available international greenhouse gas emissions data. It includes information for 191 countries and the European Union, 50 U.S. states, 6 gases, multiple economic sectors, and 160 years - carbon dioxide emissions for 1850-2014 and multi-sector greenhouse gas emission for 1990-2014.

More description is available here

  • License and reuse:

All CAIT data carries a Creative Commons Attribution-NonCommercial 4.0 International license. This means CAIT data and analysis can be used in non-commercial applications, provided clear attribution to WRI/CAIT is given. Additionally to citing CAIT it is recommanded consider citing the data sources that CAIT is using.

CAIT 2.0 UNFCCC data derives directly from United Nations Framework Convention on Climate Change (UNFCCC) Secretariat. Additionally to citing CAIT 2.0 please consider citing UNFCCC data source that CAIT 2.0 is using: United Nations Framework Convention on Climate Change (UNFCCC) Secretariat. 2013. “Time Series – Annex I.” Bonn: UNFCCC.

# data processing

ghg_emissions_wri_CAIT = ghg_emissions_wri %>% 
  # select all world data & all gases data & total sector
  filter(Data.source == "CAIT",
         Country == "World", 
         Gas == "All GHG",
         Sector == "Total including LUCF") %>% 
  # pivot data
  pivot_longer(
    cols = starts_with("X"), 
    names_to = "year",
    names_prefix = "X",
    values_to = "value") %>% 
  mutate_at("year" , as.numeric) %>% 
  arrange(year)

# plot table
ghg_emissions_wri_CAIT %>% 
  kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover"), full_width = F, font_size = 13) %>% 
  scroll_box(width = "100%", height = "200px")
Country Data.source Sector Gas Unit year value
World CAIT Total including LUCF All GHG MtCO2e 1850 N/A
World CAIT Total including LUCF All GHG MtCO2e 1851 N/A
World CAIT Total including LUCF All GHG MtCO2e 1852 N/A
World CAIT Total including LUCF All GHG MtCO2e 1853 N/A
World CAIT Total including LUCF All GHG MtCO2e 1854 N/A
World CAIT Total including LUCF All GHG MtCO2e 1855 N/A
World CAIT Total including LUCF All GHG MtCO2e 1856 N/A
World CAIT Total including LUCF All GHG MtCO2e 1857 N/A
World CAIT Total including LUCF All GHG MtCO2e 1858 N/A
World CAIT Total including LUCF All GHG MtCO2e 1859 N/A
World CAIT Total including LUCF All GHG MtCO2e 1860 N/A
World CAIT Total including LUCF All GHG MtCO2e 1861 N/A
World CAIT Total including LUCF All GHG MtCO2e 1862 N/A
World CAIT Total including LUCF All GHG MtCO2e 1863 N/A
World CAIT Total including LUCF All GHG MtCO2e 1864 N/A
World CAIT Total including LUCF All GHG MtCO2e 1865 N/A
World CAIT Total including LUCF All GHG MtCO2e 1866 N/A
World CAIT Total including LUCF All GHG MtCO2e 1867 N/A
World CAIT Total including LUCF All GHG MtCO2e 1868 N/A
World CAIT Total including LUCF All GHG MtCO2e 1869 N/A
World CAIT Total including LUCF All GHG MtCO2e 1870 N/A
World CAIT Total including LUCF All GHG MtCO2e 1871 N/A
World CAIT Total including LUCF All GHG MtCO2e 1872 N/A
World CAIT Total including LUCF All GHG MtCO2e 1873 N/A
World CAIT Total including LUCF All GHG MtCO2e 1874 N/A
World CAIT Total including LUCF All GHG MtCO2e 1875 N/A
World CAIT Total including LUCF All GHG MtCO2e 1876 N/A
World CAIT Total including LUCF All GHG MtCO2e 1877 N/A
World CAIT Total including LUCF All GHG MtCO2e 1878 N/A
World CAIT Total including LUCF All GHG MtCO2e 1879 N/A
World CAIT Total including LUCF All GHG MtCO2e 1880 N/A
World CAIT Total including LUCF All GHG MtCO2e 1881 N/A
World CAIT Total including LUCF All GHG MtCO2e 1882 N/A
World CAIT Total including LUCF All GHG MtCO2e 1883 N/A
World CAIT Total including LUCF All GHG MtCO2e 1884 N/A
World CAIT Total including LUCF All GHG MtCO2e 1885 N/A
World CAIT Total including LUCF All GHG MtCO2e 1886 N/A
World CAIT Total including LUCF All GHG MtCO2e 1887 N/A
World CAIT Total including LUCF All GHG MtCO2e 1888 N/A
World CAIT Total including LUCF All GHG MtCO2e 1889 N/A
World CAIT Total including LUCF All GHG MtCO2e 1890 N/A
World CAIT Total including LUCF All GHG MtCO2e 1891 N/A
World CAIT Total including LUCF All GHG MtCO2e 1892 N/A
World CAIT Total including LUCF All GHG MtCO2e 1893 N/A
World CAIT Total including LUCF All GHG MtCO2e 1894 N/A
World CAIT Total including LUCF All GHG MtCO2e 1895 N/A
World CAIT Total including LUCF All GHG MtCO2e 1896 N/A
World CAIT Total including LUCF All GHG MtCO2e 1897 N/A
World CAIT Total including LUCF All GHG MtCO2e 1898 N/A
World CAIT Total including LUCF All GHG MtCO2e 1899 N/A
World CAIT Total including LUCF All GHG MtCO2e 1900 N/A
World CAIT Total including LUCF All GHG MtCO2e 1901 N/A
World CAIT Total including LUCF All GHG MtCO2e 1902 N/A
World CAIT Total including LUCF All GHG MtCO2e 1903 N/A
World CAIT Total including LUCF All GHG MtCO2e 1904 N/A
World CAIT Total including LUCF All GHG MtCO2e 1905 N/A
World CAIT Total including LUCF All GHG MtCO2e 1906 N/A
World CAIT Total including LUCF All GHG MtCO2e 1907 N/A
World CAIT Total including LUCF All GHG MtCO2e 1908 N/A
World CAIT Total including LUCF All GHG MtCO2e 1909 N/A
World CAIT Total including LUCF All GHG MtCO2e 1910 N/A
World CAIT Total including LUCF All GHG MtCO2e 1911 N/A
World CAIT Total including LUCF All GHG MtCO2e 1912 N/A
World CAIT Total including LUCF All GHG MtCO2e 1913 N/A
World CAIT Total including LUCF All GHG MtCO2e 1914 N/A
World CAIT Total including LUCF All GHG MtCO2e 1915 N/A
World CAIT Total including LUCF All GHG MtCO2e 1916 N/A
World CAIT Total including LUCF All GHG MtCO2e 1917 N/A
World CAIT Total including LUCF All GHG MtCO2e 1918 N/A
World CAIT Total including LUCF All GHG MtCO2e 1919 N/A
World CAIT Total including LUCF All GHG MtCO2e 1920 N/A
World CAIT Total including LUCF All GHG MtCO2e 1921 N/A
World CAIT Total including LUCF All GHG MtCO2e 1922 N/A
World CAIT Total including LUCF All GHG MtCO2e 1923 N/A
World CAIT Total including LUCF All GHG MtCO2e 1924 N/A
World CAIT Total including LUCF All GHG MtCO2e 1925 N/A
World CAIT Total including LUCF All GHG MtCO2e 1926 N/A
World CAIT Total including LUCF All GHG MtCO2e 1927 N/A
World CAIT Total including LUCF All GHG MtCO2e 1928 N/A
World CAIT Total including LUCF All GHG MtCO2e 1929 N/A
World CAIT Total including LUCF All GHG MtCO2e 1930 N/A
World CAIT Total including LUCF All GHG MtCO2e 1931 N/A
World CAIT Total including LUCF All GHG MtCO2e 1932 N/A
World CAIT Total including LUCF All GHG MtCO2e 1933 N/A
World CAIT Total including LUCF All GHG MtCO2e 1934 N/A
World CAIT Total including LUCF All GHG MtCO2e 1935 N/A
World CAIT Total including LUCF All GHG MtCO2e 1936 N/A
World CAIT Total including LUCF All GHG MtCO2e 1937 N/A
World CAIT Total including LUCF All GHG MtCO2e 1938 N/A
World CAIT Total including LUCF All GHG MtCO2e 1939 N/A
World CAIT Total including LUCF All GHG MtCO2e 1940 N/A
World CAIT Total including LUCF All GHG MtCO2e 1941 N/A
World CAIT Total including LUCF All GHG MtCO2e 1942 N/A
World CAIT Total including LUCF All GHG MtCO2e 1943 N/A
World CAIT Total including LUCF All GHG MtCO2e 1944 N/A
World CAIT Total including LUCF All GHG MtCO2e 1945 N/A
World CAIT Total including LUCF All GHG MtCO2e 1946 N/A
World CAIT Total including LUCF All GHG MtCO2e 1947 N/A
World CAIT Total including LUCF All GHG MtCO2e 1948 N/A
World CAIT Total including LUCF All GHG MtCO2e 1949 N/A
World CAIT Total including LUCF All GHG MtCO2e 1950 N/A
World CAIT Total including LUCF All GHG MtCO2e 1951 N/A
World CAIT Total including LUCF All GHG MtCO2e 1952 N/A
World CAIT Total including LUCF All GHG MtCO2e 1953 N/A
World CAIT Total including LUCF All GHG MtCO2e 1954 N/A
World CAIT Total including LUCF All GHG MtCO2e 1955 N/A
World CAIT Total including LUCF All GHG MtCO2e 1956 N/A
World CAIT Total including LUCF All GHG MtCO2e 1957 N/A
World CAIT Total including LUCF All GHG MtCO2e 1958 N/A
World CAIT Total including LUCF All GHG MtCO2e 1959 N/A
World CAIT Total including LUCF All GHG MtCO2e 1960 N/A
World CAIT Total including LUCF All GHG MtCO2e 1961 N/A
World CAIT Total including LUCF All GHG MtCO2e 1962 N/A
World CAIT Total including LUCF All GHG MtCO2e 1963 N/A
World CAIT Total including LUCF All GHG MtCO2e 1964 N/A
World CAIT Total including LUCF All GHG MtCO2e 1965 N/A
World CAIT Total including LUCF All GHG MtCO2e 1966 N/A
World CAIT Total including LUCF All GHG MtCO2e 1967 N/A
World CAIT Total including LUCF All GHG MtCO2e 1968 N/A
World CAIT Total including LUCF All GHG MtCO2e 1969 N/A
World CAIT Total including LUCF All GHG MtCO2e 1970 N/A
World CAIT Total including LUCF All GHG MtCO2e 1971 N/A
World CAIT Total including LUCF All GHG MtCO2e 1972 N/A
World CAIT Total including LUCF All GHG MtCO2e 1973 N/A
World CAIT Total including LUCF All GHG MtCO2e 1974 N/A
World CAIT Total including LUCF All GHG MtCO2e 1975 N/A
World CAIT Total including LUCF All GHG MtCO2e 1976 N/A
World CAIT Total including LUCF All GHG MtCO2e 1977 N/A
World CAIT Total including LUCF All GHG MtCO2e 1978 N/A
World CAIT Total including LUCF All GHG MtCO2e 1979 N/A
World CAIT Total including LUCF All GHG MtCO2e 1980 N/A
World CAIT Total including LUCF All GHG MtCO2e 1981 N/A
World CAIT Total including LUCF All GHG MtCO2e 1982 N/A
World CAIT Total including LUCF All GHG MtCO2e 1983 N/A
World CAIT Total including LUCF All GHG MtCO2e 1984 N/A
World CAIT Total including LUCF All GHG MtCO2e 1985 N/A
World CAIT Total including LUCF All GHG MtCO2e 1986 N/A
World CAIT Total including LUCF All GHG MtCO2e 1987 N/A
World CAIT Total including LUCF All GHG MtCO2e 1988 N/A
World CAIT Total including LUCF All GHG MtCO2e 1989 N/A
World CAIT Total including LUCF All GHG MtCO2e 1990 34964.58
World CAIT Total including LUCF All GHG MtCO2e 1991 35125.92
World CAIT Total including LUCF All GHG MtCO2e 1992 34982.15
World CAIT Total including LUCF All GHG MtCO2e 1993 35080.3
World CAIT Total including LUCF All GHG MtCO2e 1994 35283.88
World CAIT Total including LUCF All GHG MtCO2e 1995 36004.23
World CAIT Total including LUCF All GHG MtCO2e 1996 36022.1
World CAIT Total including LUCF All GHG MtCO2e 1997 37338.36
World CAIT Total including LUCF All GHG MtCO2e 1998 36981.63
World CAIT Total including LUCF All GHG MtCO2e 1999 36817.13
World CAIT Total including LUCF All GHG MtCO2e 2000 37438.04
World CAIT Total including LUCF All GHG MtCO2e 2001 38396.69
World CAIT Total including LUCF All GHG MtCO2e 2002 39855.92
World CAIT Total including LUCF All GHG MtCO2e 2003 40703.74
World CAIT Total including LUCF All GHG MtCO2e 2004 42477.66
World CAIT Total including LUCF All GHG MtCO2e 2005 43360.31
World CAIT Total including LUCF All GHG MtCO2e 2006 43739.49
World CAIT Total including LUCF All GHG MtCO2e 2007 44590.03
World CAIT Total including LUCF All GHG MtCO2e 2008 44953.73
World CAIT Total including LUCF All GHG MtCO2e 2009 44907.04
World CAIT Total including LUCF All GHG MtCO2e 2010 46637.83
World CAIT Total including LUCF All GHG MtCO2e 2011 47915.71
World CAIT Total including LUCF All GHG MtCO2e 2012 48477.53
World CAIT Total including LUCF All GHG MtCO2e 2013 49037.46
World CAIT Total including LUCF All GHG MtCO2e 2014 49494.56
World CAIT Total including LUCF All GHG MtCO2e 2015 49828.88
World CAIT Total including LUCF All GHG MtCO2e 2016 49312.19
World CAIT Total including LUCF All GHG MtCO2e 2017 49947.42
World CAIT Total including LUCF All GHG MtCO2e 2018 N/A
World CAIT Total including LUCF All GHG MtCO2e 2019 N/A

We observe that we don’t have values for years before 1990 neither after 2017. Let’s plot the timeserie:

ghg_emissions_wri_CAIT %>% 
  filter(year >= 1990 & year < 2017) %>% 
  plot_ly() %>% 
  add_trace(y = ~value, 
            x = ~year, 
            marker = list(color = "gray"),
            type = 'scatter',
            # type = "line",
            mode = 'lines+markers',
            orientation = "v") %>% 
  layout(title = "World GHG emissions (source: WRI - CAIT)",
         yaxis = list(title = "GHG emissions"), 
         xaxis = list(title = "Years"))

3.2.2.2 WRI - GCP

3.2.2.3 WRI - UNFCCC

3.2.2.4 WRI - PIK

3.2.3 Our world in data

# read co2 data
ghg_emissions_owid= read.csv("https://raw.githubusercontent.com/owid/co2-data/master/owid-co2-data.csv", 
                             encoding = "UTF-8")

ghg_emissions_owid_world = ghg_emissions_owid %>% 
  filter(country == "World")

-Data description:

  • Data exploration:
ghg_emissions_owid_world %>% 
  # filter(year >= 1990 & country == "World") %>%
  plot_ly() %>% 
  add_trace(y = ~co2, 
            x = ~year, 
            # marker = list(color = "gray"),
            type = 'scatter',
            # type = "line",
            mode = 'lines+markers',
            orientation = "v",
            hoverinfo = 'text',
            text = ~paste('</br> Year: ', year,
                          '</br> Value: ', co2,
                          '</br> Gas: ', "CO2",
                          '</br> Sector: ', "All",
                          '</br> Source: ', "Ourw World In Data")) %>% 
  layout(title = "CO2 emissions (source: Our World In  Data)",
         yaxis = list(title = "CO2 emissions"), 
         xaxis = list(title = "Years")) 

3.3 Data normalization

3.3.1 data modeling

  • We propose a data model for mapping the various data source identified
Column name Type Description
data.source string
data.provider string
geo.scale string
geo.code.iso2c string
geo.code.iso3c string
geo.name string
year numeric
sector string
gas string
value numeric
unit string
# create dataset
OGS_ghg_emission = data.frame(data.source = as.character(),
                              data.provider = as.character(),
                              geo.scale = as.character(),
                              geo.code.iso2c = as.character(),
                              geo.code.iso3c = as.character(),
                              geo.name = as.character(),
                              year = as.numeric(),
                              sector = as.character(),
                              gas = as.character(),
                              value = as.numeric(),
                              unit = as.character())

3.3.2 Data mapping

  • Mapping WB data
OGS.MAP.WB = function(Worldbank_data, start_date, end_date, geoscale){
  Worldbank_data_OGS = Worldbank_data %>% 
    add_column(data.source = "World.Bank",
               data.provider = "World.Bank",
               geo.scale = geoscale,
               sector = "All",
               gas = "All",
               geo.code.iso3c = NA,
               unit = "MtCO₂e") %>% 
    rename(geo.code.iso2c = iso2c,
           geo.name = country,
           value = EN.ATM.GHGT.KT.CE) %>% 
    select(data.source, data.provider, geo.scale, geo.code.iso2c, geo.code.iso3c, geo.name,
           year, sector, gas, value) %>% 
    filter(year >= start_date & year <= end_date) %>% 
    mutate(value = value * 0.001)
  
  return(Worldbank_data_OGS)
}

Worldbank_data_OGS = OGS.MAP.WB(ghg_emissions_wb_world,
                                start_date = 1970,
                                end_date = 2012,
                                geoscale = "World")
  • Mapping WRI-CAIT data
OGS.MAP.WRI.CAIT = function(wri_data, start_date, end_date, geoscale){
  wri_data_OGS = wri_data %>% 
    add_column(data.provider = "WRI.CAIT",
               geo.scale = geoscale,
               sector = "All",
               geo.code.iso3c = NA,
               geo.code.iso2c = NA,
               unit = "MtCO₂e") %>% 
    rename(data.source = Data.source,
           geo.name = Country,
           gas = Gas,
           value = value) %>% 
    select(data.source, data.provider, geo.scale, geo.code.iso2c, geo.code.iso3c, geo.name,
           year, sector, gas, value) %>% 
    filter(year >= start_date & year <= end_date) %>% 
    mutate_at("value" , as.numeric) 
  
  return(wri_data_OGS)
}

wri_data_OGS = OGS.MAP.WRI.CAIT(ghg_emissions_wri_CAIT,
                                start_date = 1990,
                                end_date = 2016,
                                geoscale = "World")
  • Mapping OWID data
OGS.MAP.OWID = function(owid_data, geoscale){
  owid_data_OGS = owid_data %>% 
    add_column(data.provider = "OWID",
               data.source = "OWID",
               geo.scale = geoscale,
               sector = "All",
               geo.code.iso2c = NA,
               unit = "MtCO₂",
               gas = "CO2") %>% 
    rename(geo.code.iso3c = iso_code,
           geo.name = country,
           value = co2) %>% 
    select(data.source, data.provider, geo.scale, geo.code.iso2c, geo.code.iso3c, geo.name,
           year, sector, gas, value) 
  
  return(owid_data_OGS)
}

owid_data_OGS = OGS.MAP.OWID(ghg_emissions_owid_world,
                             geoscale = "World")

3.3.3 Normalized data exploration

OGS_ghg_emission = bind_rows(Worldbank_data_OGS, 
                             wri_data_OGS,
                             owid_data_OGS)

# plot timeserie
OGS_ghg_emission %>% 
  filter(year >= 1990) %>%
  plot_ly() %>% 
  add_trace(y = ~value, 
            x = ~year, 
            color = ~data.provider,
            type = 'scatter',
            # type = "line",
            mode = 'lines+markers',
            orientation = "v",
            hoverinfo = 'text',
            text = ~paste('</br> Year: ', year,
                          '</br> Value: ', value,
                          '</br> Gas: ', gas,
                          '</br> Sector: ', sector,
                          '</br> Source: ', data.provider)) %>% 
  layout(title = "World GHG emissions",
         yaxis = list(title = "GHG emissions (MtCO₂)"), 
         xaxis = list(title = "Years"))

4 Country scale: France use case

4.1 Data sources

4.2 Data comparison

# wb fr mapping
#################################

ghg_emissions_wb_fr = ghg_emissions_wb %>% 
  filter(country == "France")

Worldbank_data_OGS_fr = OGS.MAP.WB(ghg_emissions_wb_fr,
                                start_date = 1970,
                                end_date = 2012,
                                geoscale = "Country")

# WRI - CAIT fr mapping
####################################


ghg_emissions_wri_CAIT_fr = ghg_emissions_wri %>% 
  # select all world data & all gases data & total sector
  filter(Data.source == "CAIT",
         Country == "France",
         Gas == "All GHG",
         Sector == "Total including LUCF") %>% 
  # pivot data
  pivot_longer(
    cols = starts_with("X"), 
    names_to = "year",
    names_prefix = "X",
    values_to = "value") %>% 
  mutate_at("year" , as.numeric) %>% 
  arrange(year)


wri_data_OGS_fr = OGS.MAP.WRI.CAIT(ghg_emissions_wri_CAIT_fr,
                                start_date = 1990,
                                end_date = 2016,
                                geoscale = "Country")




# WRI UNFCCC_AI
###############################

ghg_emissions_wri_UNFCCC_AI_fr = ghg_emissions_wri %>% 
  # select all world data & all gases data & total sector
  filter(Data.source == "UNFCCC_AI",
         Gas == "Aggregate GHGs",
         Sector == "Total GHG emissions with LULUCF",
         Country == "France") %>% 
  # pivot data
  pivot_longer(
    cols = starts_with("X"), 
    names_to = "year",
    names_prefix = "X",
    values_to = "value") %>% 
  mutate_at("year" , as.numeric) %>% 
  arrange(year)

OGS.MAP.WRI.UNFCCC = function(wri_data, start_date, end_date, geoscale){
  wri_data_OGS = wri_data %>% 
    add_column(data.provider = "WRI.UNFCCC",
               geo.scale = geoscale,
               sector = "All",
               geo.code.iso3c = NA,
               geo.code.iso2c = NA,
               unit = "MtCO₂e") %>% 
    rename(data.source = Data.source,
           geo.name = Country,
           gas = Gas,
           value = value) %>% 
    select(data.source, data.provider, geo.scale, geo.code.iso2c, geo.code.iso3c, geo.name,
           year, sector, gas, value) %>% 
    filter(year >= start_date & year <= end_date) %>% 
    mutate_at("value" , as.numeric) 
  
  return(wri_data_OGS)
}

wri_UNFCCC_data_OGS_fr = OGS.MAP.WRI.UNFCCC(ghg_emissions_wri_UNFCCC_AI_fr,
                                   start_date = 1990,
                                   end_date = 2016,
                                   geoscale = "Country")



# bind rows
################################

OGS_ghg_emission_fr = bind_rows(Worldbank_data_OGS_fr, 
                                wri_data_OGS_fr,
                                wri_UNFCCC_data_OGS_fr)

# plot timeserie
################################

OGS_ghg_emission_fr %>% 
  filter(year >= 1990) %>%
  plot_ly() %>% 
  add_trace(y = ~value, 
            x = ~year, 
            color = ~data.provider,
            type = 'scatter',
            # type = "line",
            mode = 'lines+markers',
            orientation = "v",
            hoverinfo = 'text',
            text = ~paste('</br> Year: ', year,
                          '</br> Value: ', value,
                          '</br> Gas: ', gas,
                          '</br> Sector: ', sector,
                          '</br> Source: ', data.provider)) %>% 
  layout(title = "France GHG emissions",
         yaxis = list(title = "GHG emissions (MtCO₂)"), 
         xaxis = list(title = "Years"))

5 City scale